// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SubscriptionEventArgs.cs" company="Open Trader">
//   Copyright (c) David Denis (david.denis@systemathics.com)
// </copyright>
// <summary>
//   |  Open Trader - The Open Source Systematic Trading Platform
//   |
//   |  This program is free software: you can redistribute it and/or modify
//   |  it under the terms of the GNU General Public License as published by
//   |  the Free Software Foundation, either version 2 of the License, or
//   |  (at your option) any later version.
//   |
//   |  This program is distributed in the hope that it will be useful,
//   |  but WITHOUT ANY WARRANTY; without even the implied warranty of
//   |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   |  GNU General Public License for more details.
//   |
//   |  You should have received a copy of the GNU General Public License
//   |  along with this program.  If not, see http://www.gnu.org/licenses
//   |
//   |  Up to date informations about Open Trader can be found at :
//   |    http://opentrader.org
//   |    http://opentrader.codeplex.com
//   |
//   |  For professional services, please visit us at :
//   |    http://www.systemathics.com
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Org.OpenTrader.Framework.Forge.Events
{
    #region Using Directives

    using System;

    using Org.OpenTrader.Framework.Enums;
    using Org.OpenTrader.Framework.Events;
    using Org.OpenTrader.Framework.Forge.Interfaces;

    #endregion

    /// <summary>
    /// The subscription event args.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    [Serializable]
    public class SubscriptionEventArgs<T> : EventArgs
        where T : DispatchableEventArgs
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="SubscriptionEventArgs{T}"/> class. 
        /// Initializes a new instance of the <see cref="Subscription{T}"/> class.
        /// </summary>
        /// <param name="subscriptionEventType">
        /// The subscriptionEventType.
        /// </param>
        /// <param name="wiring">
        /// The wiring.
        /// </param>
        /// <param name="dispatchHandler">
        /// The dispatchHandler.
        /// </param>
        public SubscriptionEventArgs(ESubscriptionEventType subscriptionEventType, IWiring wiring, RemotableEventHandler<T> dispatchHandler)
        {
            this.Wiring = wiring;
            this.DispatchHandler = dispatchHandler;
            this.SubscriptionEventType = subscriptionEventType;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets DispatchHandler.
        /// </summary>
        public RemotableEventHandler<T> DispatchHandler { get; private set; }

        /// <summary>
        /// Gets or sets ForwardToSubscriberArgs.
        /// </summary>
        public T[] ForwardToSubscriberArgs { get; set; }

        /// <summary>
        /// Gets SubscriptionEventType.
        /// </summary>
        public ESubscriptionEventType SubscriptionEventType { get; private set; }

        /// <summary>
        /// Gets Wiring.
        /// </summary>
        public IWiring Wiring { get; private set; }

        #endregion
    }
}